import React, { useState, useEffect } from 'react'
import './seckill.scss'
import { seckillList } from '@/models'

export default function Seckill() {
    const [SeckillList, setSeckillList] = useState([])
    useEffect(() => {
        seckillList().then(res => {
            setSeckillList(res.data)
        })
    }, [])
    return (
        <div className='seckill' style={{ height: '170px', width: '100%', padding: '0.5rem', boxSizing: 'border-box' }}>
            <div className='seckill-container'>
                <div className='sckill-header'>
                    <p className='title'>京东秒杀</p>
                    <p className='hourZero'>专场</p>
                    <div className='timer'>倒计时</div>
                </div>
                <ul className='SeckillList'>
                    {SeckillList.map(item => {
                        return (
                            <li key={item.proid}>
                                <img src={item.img1} alt="" />
                                <p>￥{item.originprice}</p>
                            </li>
                        )
                    })}
                </ul>
            </div>
        </div>
    )
}
